package cn.itcast.mapper;

import cn.itcast.pojo.EmpLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Mapper
public interface EmpLogMapper extends BaseMapper<EmpLog> {
    @Insert("insert into emp_log values (null,#{beforeOperatorData},#{afterOperatorData},#{operatorTime},#{operatorType},#{isSuccess})")
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    int add(EmpLog emplog);
}
